﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ANMCMaster.Master" AutoEventWireup="true" CodeBehind="PhotoManager.aspx.cs" Inherits="AllNations.WebAppAdmin.PhotoManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ANHeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ANBodyContent" runat="server">
    <article class="node static-page content">
        <asp:HyperLink ID="lnkManager" runat="server" />
        <telerik:RadMultiPage ID="PhotoManViews" runat="server" SelectedIndex="0" RenderSelectedPageOnly="true"  Width="100%">
            <telerik:RadPageView ID="ListView" runat="server">
                <asp:Repeater ID="dlPhotoalbum" runat="server">
                    <HeaderTemplate>
                        <table cellpadding="4" cellspacing="1" border="0" style="background-color: Silver">
                            <tr style="background-color: #f0f0f0">
                                <td><strong>Photo</strong></td>
                                <td><strong>Title</strong></td>
                                <td><strong>#Photo</strong></td>
                                <td><strong>Archived?</strong></td>
                                <td>&nbsp;</td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr style="background-color: White">
                            <td style="text-align: center">
                                <asp:Image ID="imgPhotoAlbumPhoto" runat="server" AlternateText='<%# Eval("TitleTxt") %>' Visible='<%# !(bool)Eval("ArchiveInd") %>' ImageUrl='<%# string.Format("/PhotoHandler.ashx?PhotoId={0}", Eval("LatestPhotoId")) %>' />
                                <asp:Label ID="lnkNA" runat="server" Text="Available on edit page" ForeColor="Silver" Visible='<%# Eval("ArchiveInd") %>' /></td>
                            <td>
                                <%# Eval("TitleTxt") %></td>
                            <td style="text-align: center">
                                <%# Eval("PhotoCnt") %></td>
                            <td style="text-align: center">
                                <%# (bool)Eval("ArchiveInd") ? "Yes" : "No" %></td>
                            <td>
                                <asp:HyperLink ID="lnkEditDetail" runat="server" Text="Edit" NavigateUrl='<%# string.Format("/WebAppAdmin/PhotoManager.aspx?PhotoalbumId={0}", Eval("PhotoalbumId")) %>' /></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </telerik:RadPageView>
            <telerik:RadPageView ID="AlbumView" runat="server">
                <table cellpadding="4" cellspacing="1" border="0" style="background-color: Silver; width: 100%">
                    <tr style="background-color: White">
                        <td style="white-space: nowrap">
                            <strong>Album Title:</strong></td>
                        <td style="width: 100%">
                            <asp:TextBox ID="txtTitle" runat="server" MaxLength="100" CssClass="FieldR2" Columns="75" /></td>
                    </tr>
                    <tr style="background-color: White">
                        <td style="white-space: nowrap">
                            &nbsp;</td>
                        <td>
                            <asp:CheckBox ID="cbArchiveInd" runat="server" Text="Archived?" /></td>
                    </tr>
                    <tr style="background-color: White">
                        <td style="white-space: nowrap">
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="btSaveAlbum" runat="server" Text="Save Album" CssClass="ButtonR2" OnClick="btSaveAlbum_Click" UseSubmitBehavior="false" /></td>
                    </tr>
                </table>
                <asp:Panel ID="panelAddPhoto" runat="server">
                    <div style="padding-top: 20px; padding-bottom: 5px;"><strong>Add Photos</strong></div>
                    <telerik:RadUpload ID="fuPhoto" runat="server"  InitialFileInputsCount="4" MaxFileInputsCount="4" />
                    <asp:Button ID="btAddPhotoToAlbum" runat="server" Text="Add Photo" UseSubmitBehavior="false" CssClass="ButtonR2" OnClick="btAddPhotoToAlbum_Click" />
                </asp:Panel>

                <div style="padding-top: 20px; padding-bottom: 5px;"><strong>Current Photos</strong></div>
                <asp:Repeater ID="rptPhoto" runat="server">
                    <HeaderTemplate>
                        <table cellpadding="4" cellspacing="1" border="0" style="background-color: Silver; width: 100%">
                            <tr style="background-color: White">
                                <td><strong>Thumbnail</strong></td>
                                <td><strong>Title</strong>/<strong>Description</strong></td>
                                <td><strong>Featured?</strong></td>
                                <td>&nbsp;</td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr style="background-color: White; vertical-align: top">
                            <td>
                                <asp:Image ID="imgPhoto" runat="server" AlternateText='<%# Eval("TitleTxt") %>' ImageUrl='<%# string.Format("/PhotoHandler.ashx?PhotoId={0}", Eval("PhotoId")) %>' />
                                <asp:HiddenField ID="hidPhotoId" runat="server" Value='<%# Eval("PhotoId") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="txtTitle" runat="server" CssClass="FieldR2" Columns="60" MaxLength="100" Text='<%# Eval("TitleTxt") %>' /><br />
                                <asp:TextBox ID="txtDesc" runat="server" CssClass="MultiLineFieldR2" Columns="60" Text='<%# Eval("DescTxt") %>' TextMode="MultiLine" Rows="5" Width="98%" />
                            </td>
                            <td style="text-align: center"><asp:Label ID="lblFeaturedInd" runat="server" Text='<%# (bool)Eval("FeaturedInd") ? "Yes" : "No" %>' /></td>
                            <td><asp:CheckBox ID="cbSelect" runat="server" /></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                            <tr style="background-color: White">
                                <td colspan="4">
                                    <asp:Button ID="btUpdatePhoto" runat="server" OnClick="btUpdatePhoto_Click" Text="Update Photo" CssClass="ButtonR2" UseSubmitBehavior="false" />
                                    <asp:Button ID="btFeatureSel" runat="server" OnClick="btFeatureSel_Click" Text="Feature Selected" CssClass="ButtonR2" UseSubmitBehavior="false" />
                                    <asp:Button ID="btDeleteSel" runat="server" OnClick="btDeleteSel_Click" Text="Delete Selected" CssClass="ButtonR2" UseSubmitBehavior="false" OnClientClick="if (!confirm('You are about to delete photo(s).  You cannot undo this action, continue?')) return false;" />
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </telerik:RadPageView>
            <telerik:RadPageView ID="CreateView" runat="server">
                <table cellpadding="4" cellspacing="1" border="0" style="background-color: Silver; width: 100%">
                    <tr style="background-color: White">
                        <td style="white-space: nowrap">
                            <strong>Album Title:</strong></td>
                        <td style="width: 100%">
                            <asp:TextBox ID="txtTitleNew" runat="server" MaxLength="100" CssClass="FieldR2" Columns="75" /></td>
                    </tr>
                    <tr style="background-color: White" id="tr1" runat="server">
                        <td style="white-space: nowrap">
                            <strong>Select Photo:</strong></td>
                        <td style="width: 100%">
                            <telerik:RadUpload ID="fuPhotoNew" runat="server"  InitialFileInputsCount="4" MaxFileInputsCount="4" /></td>
                    </tr>
                    <tr style="background-color: White">
                        <td style="white-space: nowrap">
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="btCreateAlbum" runat="server" Text="Create Album" UseSubmitBehavior="false" CssClass="ButtonR2" OnClick="btCreateAlbum_Click" />
                            <asp:Button ID="btCancelCreate" runat="server" Text="Cancel" UseSubmitBehavior="false" CssClass="ButtonR2" />
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="FeaturedPhotoView" runat="server">
                <div style="padding-top: 20px; padding-bottom: 5px;"><strong>Featured Photos</strong></div>
                <asp:Repeater ID="rptFeaturedPhoto" runat="server">
                    <HeaderTemplate>
                        <table cellpadding="4" cellspacing="1" border="0" style="background-color: Silver; width: 100%">
                            <tr style="background-color: White">
                                <td><strong>Thumbnail</strong></td>
                                <td><strong>Title</strong>/<strong>Description</strong></td>
                                <td><strong>Featured?</strong></td>
                                <td>&nbsp;</td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr style="background-color: White; vertical-align: top">
                            <td>
                                <asp:Image ID="imgPhoto" runat="server" AlternateText='<%# Eval("TitleTxt") %>' ImageUrl='<%# string.Format("/PhotoHandler.ashx?PhotoId={0}", Eval("PhotoId")) %>' />
                                <asp:HiddenField ID="hidPhotoId" runat="server" Value='<%# Eval("PhotoId") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="txtTitle" runat="server" CssClass="FieldR2" Columns="60" MaxLength="100" Text='<%# Eval("TitleTxt") %>' /><br />
                                <asp:TextBox ID="txtDesc" runat="server" CssClass="MultiLineFieldR2" Columns="60" Text='<%# Eval("DescTxt") %>' TextMode="MultiLine" Rows="5" Width="98%" />
                            </td>
                            <td style="text-align: center"><asp:Label ID="lblFeaturedInd" runat="server" Text='<%# (bool)Eval("FeaturedInd") ? "Yes" : "No" %>' /></td>
                            <td><asp:CheckBox ID="cbSelect" runat="server" /></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                            <tr style="background-color: White">
                                <td colspan="4">
                                    <asp:Button ID="btUpdatePhoto" runat="server" OnClick="btUpdatePhoto_Click2" Text="Update Photo" CssClass="ButtonR2" UseSubmitBehavior="false" />
                                    <asp:Button ID="btUnFeatureSel" runat="server" OnClick="btUnFeatureSel_Click" Text="Remove Selected from Featured" CssClass="ButtonR2" UseSubmitBehavior="false" />
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </article>
</asp:Content>
